package com.bjsdzk.common.utils;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;

/**
 * 胜顶智控平台管理
 * 集合判空工具类
 *
 * @author YangTang
 * @time 2019/6/28.
 */
public class CollectionUtils {

    public static List toList(Collection collection) {
        List list = new ArrayList();
        Iterator it = collection.iterator();
        while (it.hasNext()) {
            list.add(it.next());
        }
        return list;
    }

    public static boolean isEmpty(List<? extends Object> list) {
        return list == null || list.size() <= 0;
    }

    public static boolean isNotEmpty(List<? extends Object> list) {
        return list != null && list.size() > 0;
    }
}
